package com.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

import com.matang.R;

public class GiftHoriView extends FrameLayout {
	Context context;
	ImageView iv;
	TextView numTv;
	
	public GiftHoriView(Context context) {
		super(context);
		init(context);
	}

	public GiftHoriView(Context context, AttributeSet attrs) {
		super(context, attrs);
		init(context);
	}

	public GiftHoriView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		init(context);
	}
	void init(Context context){
		this.context = context;
		View view = LayoutInflater.from(context).inflate(
				R.layout.view_gift_hori_view, this);
		iv = (ImageView) view.findViewById(R.id.giftIv);
		numTv = (TextView) view.findViewById(R.id.numTv);
	}
	public void setImageResource(int resId){
		iv.setImageResource(resId);
	}
	public void setGiftNum(int num){
		numTv.setText(num+"");
		numTv.setVisibility(View.VISIBLE);
	}
	
}
